home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 2.3 KB | 78 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Frame.cpp
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "Frame.h"
- #include "Part.h"
-
- // ----- Framework Includes -----
- #include "FWUtil.h"
- #include "FWContxt.h"
- #include "FWRecShp.h"
-
- #ifdef FW_BUILD_MAC
- #pragma segment CFrame
- #endif
-
- FW_DEFINE_AUTO(CFrame)
-
- //----------------------------------------------------------------------------------------
- // Standard CFrame Methods
- //----------------------------------------------------------------------------------------
-
- CFrame::CFrame (Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CPart* part)
- : FW_CFrame(ev, odFrame, presentation, part)
- , fPart (part)
- {
- FW_END_CONSTRUCTOR
- }
-
- CFrame::~CFrame()
- {
- FW_START_DESTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // Cyberdog Support
- //----------------------------------------------------------------------------------------
-
- void CFrame::Draw (Environment *ev, ODFacet* odFacet, ODShape* invalidShape)
- {
- FW_CViewContext fc (ev, this, odFacet, invalidShape);
- FW_CRect invalidRect;
- fc.GetClipRect (invalidRect);
- ::EraseRect (&fc.LogicalToDevice (invalidRect));
-
- DrawUpdate (ev, fc);
- }
-
- void CFrame::DrawUpdate (Environment *ev, FW_CGraphicContext & gc)
- {
- // I call this to draw the content w/o erasing first (avoids flashiness)
- // This is useful during incremental downloads when we only need to display
- // additional content
-
- // When we're using platform graphics (as opposed to ODF's FWGraphx module) we have
- // to reset things a lot - other parts tend to leave the GrafPort in a random state.
- ::TextFont(1);
- ::TextFace(0);
- ::TextSize(0);
- ::ForeColor (blackColor);
- ::BackColor (whiteColor);
-
- FW_CRect bounds (FW_kZeroPoint, GetSize(ev));
- FW_SPlatformRect pBounds = gc.LogicalToDevice (bounds);
- ::InsetRect (&pBounds, 4, 4);
- ::HLock (fPart->fDownloadedText);
- unsigned long size = GetHandleSize(fPart->fDownloadedText);
- if (size > 32767) size = 32767; // TE can't draw it, but we shouldn't truncate it
- ::TETextBox (*fPart->fDownloadedText, size, &pBounds, teFlushDefault);
- ::HUnlock (fPart->fDownloadedText);
- }
-
-